<!--<!DOCTYPE html>

<html>

	<head>
		<meta charset="utf-8">
		<title>车协官网后台管理</title>
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="format-detection" content="telephone=no">

		<link rel="stylesheet" href="/admin/plugins/layui/css/layui.css" media="all" />
		<link rel="stylesheet" href="/admin/css/global.css" media="all">
		<link rel="stylesheet" href="/admin/plugins/font-awesome/css/font-awesome.min.css">

	</head>

	<body>
		<div class="layui-layout layui-layout-admin">
			<div class="layui-header header header-demo">
				<div class="layui-main">
					<div class="admin-login-box">
						<a class="logo" style="left: 0;" href="http://beginner.zhengjinfan.cn/demo/beginner_admin/">
							<span style="font-size: 22px;">后台管理</span>
						</a>
						<div class="admin-side-toggle">
							<i class="fa fa-bars" aria-hidden="true"></i>
						</div>
					</div>
					<ul class="layui-nav admin-header-item">
						<li class="layui-nav-item">
							<span>欢迎您<%=host%>:</span>
						</li>
						<li class="layui-nav-item">
							<a href="/" target="_blank">浏览网站</a>
						</li>
						<li class="layui-nav-item" >
							<a href="/logout"><i class="fa fa-sign-out"></i> 注销</a>
						</li>

					</ul>

				</div>
			</div>
			<div class="layui-side layui-bg-black" id="admin-side">
				<div class="layui-side-scroll" id="admin-navbar-side" lay-filter="side"></div>
			</div>
			<div class="layui-body" style="bottom: 0;border-left: solid 2px #1AA094;" id="admin-body">
				<div class="layui-tab admin-nav-card layui-tab-brief" lay-filter="admin-tab">
					<ul class="layui-tab-title">
						<li class="layui-this">
							<i class="fa fa-dashboard" aria-hidden="true"></i>
							<cite>主页</cite>
						</li>
					</ul>-->
					<%include common/include_header.html%>
					<div class="layui-tab-content" style="min-height: 150px; padding: 5px 0 0 0;">
						<div>
							<div style="margin: 15px;">
		<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
			<legend>添加文化</legend>
		</fieldset>

		<form class="layui-form" action="">
			<div class="layui-form-item">
				<label class="layui-form-label">新闻标题</label>
				<div class="layui-input-block">
					<input type="text" id="title" name="title"  autocomplete="off" placeholder="请输入标题" class="layui-input">
				</div>
			</div>




			<div class="layui-form-item">
				<label class="layui-form-label">类别</label>
				<div class="layui-input-block">
					<input type="radio" name="category" value="0" title="领导关怀" checked="">
					<input type="radio" name="category" value="1" title="党团建设">
					<input type="radio" name="category" value="2" title="培训教育">
					<input type="radio" name="category" value="3" title="文体活动">
					<input type="radio" name="category" value="4" title="员工风采">
					<input type="radio" name="category" value="5" title="成长历程">
				</div>
			</div>





			<div class="layui-form-item layui-form-text">
				<label class="layui-form-label">编辑内容</label>
				<div class="layui-input-block">
					<script id="editor" type="text/plain" style="width:1024px;height:800px;"></script>
					<!--<textarea class="layui-textarea layui-hide" name="content" lay-verify="content" id="LAY_demo_editor"></textarea>-->
				</div>
			</div>

			<div class="layui-form-item">
				<div class="layui-input-block">
					<button class="layui-btn" lay-submit="" id="add">立即提交</button>
					<button type="reset" class="layui-btn layui-btn-primary">重置</button>
				</div>
			</div>
		</form>
	</div>
						</div>
					</div>
				
			<%include common/include_footer.html%>
			<!--<div class="layui-footer footer footer-demo" id="admin-footer">
				<div class="layui-main">
					<p>2018 &copy;
						<a href="/">惠升后台管理系统</a> LGPL license
					</p>
				</div>
			</div>
			<div class="site-tree-mobile layui-hide">
				<i class="layui-icon">&#xe602;</i>
			</div>-->

			<script type="text/javascript" charset="utf-8" src="/ueditor/ueditor.config.js"></script>
		<script type="text/javascript" charset="utf-8" src="/ueditor/ueditor.all.min.js"> </script>
			<script type="text/javascript" src="/admin/plugins/layui/layui.js"></script>
			<!--<script type="text/javascript" src="/admin/datas/nav.js"></script>-->
			<script src="/admin/js/index1.js"></script>
			<script>
				layui.use(['form', 'laydate','upload'], function() {
			var form = layui.form(),
					layer = layui.layer,
					laydate = layui.laydate,
					$= layui.jquery;
			var ue = UE.getEditor('editor');
			//监听提交
			//点击添加分类
			$('#add').on('click', function() {
				var title=$("#title").val();
				var myDate=new Date();
				var month=myDate.getMonth()+1;
				month=month<10?"0"+month:month;
				var date=myDate.getDate()<10?"0"+myDate.getDate():myDate.getDate();
				var hour=myDate.getHours()<10?"0"+myDate.getHours():myDate.getHours();
				var minutes=myDate.getMinutes()<10?"0"+myDate.getMinutes():myDate.getMinutes();
				var time=myDate.getFullYear()+"-"+month+"-"+date+" "+hour+":"+minutes;
				var from=$("#from").val();
				//获取选中的radio的内容
				var category=$('input:radio:checked').val();
				//获取多文本编辑内容
				var content=UE.getEditor('editor').getContent();
				//测试用户是否录入信息
				if(title==""||time==""||content==""){
					layer.alert('请填入相关信息');
					return false;
				}
				/*alert("title"+title+"time"+time+"from"+from+"from"+imgurl+"content"+content);*/
				$.post("/admin/add_cultrue",{title:title,time:time,category:category,content:content},function(result){
					if(result.status==="success"){
						layer.alert('添加成功,请在企业文化查看。', {icon: 1},()=>{
              open("/admin/cultrue_list","_self")
            });
					}else{
						layer.alert('添加失败', {icon: 2});
					}
				});
				//这句话的意思不会刷新当前页面。避免清空内容
				return false;
			});
		});			</script>
		</div>
	</body>

</html>